<div class="listDiv" style="height:85%;">
    <table class="listTab" cellpadding="0" cellspacing="0">
        <thead>
        <tr>
            <td width="5%"><span></span>编号</td>
            <td width="20%"><span></span>标题</td>
            <td width="15%"><span></span>内容</td>
            <td width="10%"><span></span>创建日期</td>
            <td width="15%">操作&nbsp;&nbsp;<a id="adds" href="/sitemanage/Bulletinadd/">[新增公告]</a></td>
        </tr>
        </thead>
        <tbody>
        <?php $key = 0;?>
        <?php foreach ($bulletin_list as $item):?>
            <?php $key++;?>
        <tr>
            <td><?=$key?>&nbsp;</td>
            <td><span><?=$item['title']?>&nbsp;</span></td>
            <td><?=Isubstr($item['content'], 10, false)?>&nbsp;</td>
            <td><?=date("Y-m-d", $item['created'])?>&nbsp;</td>
            <td align="left">
                <a id="edit" rel="<?=$item['id']?>" href="/sitemanage/bulletinedit/?id=<?=$item['id']?>">编辑</a>

                <a id="drop" rel="<?=$item['id']?>" href="#">删除</a>
            </td>
        </tr>
            <?php endforeach;?>
        </tbody>
    </table>
</div>

<script type="text/javascript">
    $(document).ready(function(){

        // 永久删除记录
        $("a#drop").live('click',function(){
            var $ts = $(this).attr('rel');
            var $tr = $(this).parents("tr");
            parent.$.dooDialog.confirm("你确定要删除这条公告吗？",function(){
                $.post('/sitemanage/bulletindel',{id:$ts},function(data){
                        if(data.code=='OK'){
                            $tr.remove();
                            $('tr.tr' + $ts).remove();
                        }else{
                            parent.$.dooDialog.alert('这个公告删除失败！');
                            return false;
                        }
                    }
                    ,'json');
            });
            return false;
        });


    });
</script>
